<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>vue-局部组件</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

</head>

<body>
    <div id="app">
        <h1>helloworld</h1>
        <my-component></my-component>
        <my-component></my-component>
        <my-component></my-component>

    </div>
    <div id="app1">
        <h6>连写</h6>
        <my-component2></my-component2>


    </div>
    <div id="app2">
        <h2>这个用不了，因为是局部组件</h2>
        <my-component></my-component>
        <my-component></my-component>

    </div>
    <script>
        let Profile = Vue.extend({
            // 1.模板选项
            template: `
          <div>
            <input type="date">
            <p>fdssfioaf</p>  
          </div>
        `
        });

        // 局部模板， 在新建实列的时候注册
        new Vue({
            el: document.getElementById('app'),
            components: {
                "myComponent": Profile
            }
        });
    </script>
    <script>
        new Vue({
            el: '#app1',
            components: {
                "myComponent2": {
                    template: `
                      <div>
                        <input type="date">
                        <p>fdssfioaf</p>  
                      </div>
                  `
                }
            }

        });
    </script>
</body>



</html>